package com.hk.controller.admin;

import com.hk.model.dto.CluesAddDto;
import com.hk.model.dto.CluesPageDto;
import com.hk.model.vo.CluesPageVo;
import com.hk.result.Result;
import com.hk.service.CluesService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/clues/clue")
@ApiOperation(value = "线索模块")
public class CluesController {
    @Autowired
    private CluesService cluesService;

    @ApiOperation("分页查询线索")
    @GetMapping("/list")
    public CluesPageVo list(CluesPageDto cluesPageDto) {
        return cluesService.pageList(cluesPageDto);
    }

    @ApiOperation("分页查询线索池")
    @GetMapping("/poor")
    public CluesPageVo poor(CluesPageDto cluesPageDto) {
        return cluesService.pagePoor(cluesPageDto);
    }

    @PostMapping
    public Result addClues(@RequestBody CluesAddDto dto) {
        cluesService.addClues(dto);
        return Result.success();
    }

}
